<include file="public/layout" />
<script type="text/javascript" src="__ROOT__/public/static/js/layer/laydate/laydate.js"></script>

<body style="background-color: rgb(255, 255, 255); overflow: auto; cursor: default; -moz-user-select: inherit;">
<div id="append_parent"></div>
<div id="ajaxwaitid"></div>
<div class="page">
  <div class="fixed-bar">
    <div class="item-title">
      <div class="subject">
        <h3>服务订单列表</h3>
        <h5>寄修订单列表</h5>
      </div>
    </div>
  </div>
  <!-- 操作说明 -->
  <div id="explanation" class="explanation" style="color: rgb(44, 188, 163); background-color: rgb(237, 251, 248); width: 99%; height: 100%;">
    <div id="checkZoom" class="title"><i class="fa fa-lightbulb-o"></i>
      <h4 title="提示相关设置操作时应注意的要点">操作提示</h4>
      <span title="收起提示" id="explanationZoom" style="display: block;"></span>
    </div>
     <ul>
      <li>点击查看操作将显示订单（包括订单物品）的详细信息</li>
      <li>已发货订单列表</li>
    </ul>
  </div>
  <div class="flexigrid">
    <div class="mDiv">
      <div class="ftitle">
        <h3>发货单列表</h3>
        <h5>(共{$page->totalRows}条记录)</h5>
      </div>
      <div title="刷新数据" class="pReload"><i class="fa fa-refresh"></i></div>
	  <form class="navbar-form form-inline"  method="post" action="{:U('Order.Order/ajax_to_shop_list')}"  name="search-form2" id="search-form2" onsubmit="return false">
	  		<input type="hidden" name="order_by" value="order_id">
            <input type="hidden" name="case_action" value="send">
            <input type="hidden" name="sort" value="desc">
            <input type="hidden" name="user_id" value="{$Request.param.user_id}">
            <!--用于查看结算统计 包含了哪些订单-->
            <input type="hidden" value="{$_GET['order_statis_id']}" name="order_statis_id" />
                                    
      <div class="sDiv">
        <div class="sDiv2">
        	<input type="text" size="30" id="order_sn" name="order_sn" value="" class="qsbox"  placeholder="订单编号">
        </div>
        <div class="sDiv2">  
            <select name="order_status" class="select" style="width:100px;margin-right:5px;margin-left:5px">
                    <option value="0">--请选择--</option>
                    <option value="1">接单中</option>  
                    <option value="2">维修中</option>
                    <option value="3">已完成</option>
                    <option value="4">待评价</option>
                    <option value="5">已作废</option>
            </select>
        </div>
        <div class="sDiv2">  
            <select name="order_type" class="select" style="width:100px;margin-right:5px;margin-left:5px">
                    <option value="0">--请选择--</option>
                    <option value="1">寄修</option>
                    <option value="2">上门</option>
                    <option value="3">到店</option>
            </select>
        </div>
        <div class="sDiv2">  
            <select name="order_state" class="select" style="width:100px;margin-right:5px;margin-left:5px">
                    <option value="0">--请选择--</option>
                    <option value="1">商品安装</option>
                    <option value="2">维修服务</option>
            </select>
        </div>
        <div class="sDiv2">  
            <select name="pay_status" class="select" style="width:100px;margin-right:5px;margin-left:5px">
                    <option value="0">--请选择--</option>
                    <option value="1">未支付</option>
                    <option value="2">已支付</option>
            </select>
        </div>
        <div class="sDiv2">	 
          <input type="button" onclick="ajax_get_table('search-form2',1)"  class="btn" value="搜索">
        </div>
      </div>
     </form>
    </div>
    <div class="hDiv">
      <div class="hDivBox" id="ajax_return">
        <table cellspacing="0" cellpadding="0">
          <thead>
	        	<tr>
	              <th class="sign" axis="col0">
	                <div style="width: 24px;"><i class="ico-check"></i></div>
	              </th>
	              <th align="left" abbr="order_sn" axis="col3" class="">
	                <div style="text-align: left; width: 140px;" class=""><a href="javascript:sort('order_sn');">订单编号</a></div>
	              </th>
	              <th align="left" abbr="add_time" axis="col4" class="">
	                <div style="text-align: left; width: 120px;" class=""><a href="javascript:sort('add_time');">下单时间</a></div>
	              </th>
	              <th align="left" abbr="user_id" axis="col4" class="">
	                <div style="text-align: left; width: 140px;" class="">下单用户</div>
	              </th>
	              <th align="center" abbr="order_state" axis="col6" class="">
	                <div style="text-align: center; width: 70px;" class="">订单标识</div>
	              </th>
                  <th align="center" abbr="order_status" axis="col5" class="">
                    <div style="text-align: center; width: 70px;" class=""><a href="javascript:sort('order_status');">订单状态</a></div>
                  </th>
                  <th align="center" abbr="order_type" axis="col5" class="">
                    <div style="text-align: center; width: 70px;" class=""><a href="javascript:sort('order_type');">订单类型</a></div>
                  </th>
	              <th align="center" abbr="pay_status" axis="col6" class="">
	                <div style="text-align: center; width: 70px;" class=""><a href="javascript:sort('pay_status');">支付状态</a></div>
	              </th>
	              <th align="center" abbr="total_price" axis="col6" class="">
	                <div style="text-align: center; width: 100px;" class="">订单总价</div>
	              </th>
                <th align="center" abbr="total_price" axis="col6" class="">
                  <div style="text-align: center; width: 100px;" class="">实付价格</div>
                </th>
	              <th align="center" axis="col1" class="handle">
	                <div style="text-align: center; width: 150px;">操作</div>
	              </th>
	              <th style="width:100%" axis="col7">
	                <div></div>
	              </th>
	            </tr>
	          </thead>
        </table>
      </div>
    </div>
    <div class="bDiv" style="height: auto;">
      <div id="flexigrid" cellpadding="0" cellspacing="0" border="0">
        
      </div>
      <div class="iDiv" style="display: none;"></div>
    </div>
    <!--分页位置--> 
   	</div>
</div>
<script type="text/javascript">

	 
    $(document).ready(function(){	
     	
		// 点击刷新数据
		$('.fa-refresh').click(function(){
			location.href = location.href;
		});
		
		ajax_get_table('search-form2',1);
		
		$('.ico-check ' , '.hDivBox').click(function(){
			$('tr' ,'.hDivBox').toggleClass('trSelected' , function(index,currentclass){
	    		var hasClass = $(this).hasClass('trSelected');
	    		$('tr' , '#flexigrid').each(function(){
	    			if(hasClass){
	    				$(this).addClass('trSelected');
	    			}else{
	    				$(this).removeClass('trSelected');
	    			}
	    		});  
	    	});
		});
		 
	});
    
    
 // ajax 抓取页面
    function ajax_get_table(tab,page){
        cur_page = page; //当前页面 保存为全局变量
            $.ajax({
                type : "POST",
                url:"/index.php/Admin/Order.Order/ajax_to_shop_list/p/"+page,//+tab,
                data : $('#'+tab).serialize(),// 你的formid
                success: function(data){
                    // console.log(data);
                    $("#flexigrid").html('');
                    $("#flexigrid").append(data);
                }
            });
    }
	
 // 点击排序
    function sort(field)
    {
        $("input[name='order_by']").val(field);
        var v = $("input[name='sort']").val() == 'desc' ? 'asc' : 'desc';
        $("input[name='sort']").val(v);
        ajax_get_table('search-form2',cur_page);
    }
	 
</script>
</body>
</html>